estimates clear 

clear

use ".\Dropbox\Vaccination\dma_sample.dta" //load the data

gen x=(statefips==48|statefips==15) // identify states without the vaccination data

bysort google_dma: egen drop=max(x)
drop if drop==1 // drop DMAs crossing states without the vaccination data
drop if rep_house2016 ==. // drop DMAs without the house election data for consistency

zscore(rep*2016 vacc* america2014 socialdist_avg* mask hesitant)

label variable z_rep_pres2016 "Trump vote share, 2016"

local DMA "lat lon temp rain income native_share white_share col_share elder_share male_share  mfg_share_diff popden" // socio-economic controls

 ivreg2 z_hesitant (z_rep_pres2016=z_america2014) i.division  , robust
estimates store hesitant_geo

 ivreg2 z_hesitant (z_rep_pres2016=z_america2014)  `DMA' i.division  , robust
estimates store hesitant_all


 ivreg2 z_mask (z_rep_pres2016=z_america2014) i.division  , robust
estimates store mask_geo

 ivreg2 z_mask (z_rep_pres2016=z_america2014)  `DMA' i.division  , robust
estimates store mask_all


 ivreg2 z_socialdist (z_rep_pres2016=z_america2014) i.division  , robust
estimates store socialdist_geo

 ivreg2 z_socialdist (z_rep_pres2016=z_america2014)  `DMA' i.division  , robust
estimates store socialdist_all

estout hesi* mask* social* using ".\Dropbox\Vaccination\Draft\tab_alternative_iv.tex", replace style(tex) cells(b(fmt(3) star) se(par fmt(3))) stats(widstat N, fmt(2 0) labels("Kleibergen-Paap F-stat" "Observations")) keep(z_rep_pres2016) label mlabels(none) collabels(none) starlevels(* 0.10 ** 0.05 *** 0.01)
